package com.example.dao;

import com.example.entity.DishTagsEntity;
import com.example.mybatis.dao.BaseDao;
import com.example.entity.TagsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* 标签
*
* @author yyyyjinying 1020066395@qq.com
* @since 1.0-SNAPSHOT 2025-04-29
*/
@Mapper
public interface TagsDao extends BaseDao<TagsEntity> {

    List<TagsEntity> tagByDishId(@Param("dishId") Long dishId, @Param("tagIds") List<Long> tagIds);
    void delRelation(@Param("dishId") Long dishId, @Param("tagIds") List<Long> tagIds);
    // 中间表的批量插入
    void batchInsertDishTagRelation(@Param("lists") List<DishTagsEntity> lists);
    List<DishTagsEntity> findRelation(@Param("lists") List<DishTagsEntity> lists);
    List<DishTagsEntity> findNotRelation(@Param("lists") List<DishTagsEntity> lists);
    List<DishTagsEntity> selectRelationByTag(@Param("tagId") Long tagId);
    // 中间表的批量删除
    void deleteDishTagRelation(@Param("dishIds") List<Long> dishIds, @Param("tagIds") List<Long> tagIds);
}